package org.springblade.modules.repair.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;import org.apache.ibatis.annotations.Param;
import org.springblade.modules.repair.dto.PlanCheckHistoryListDTO;
import org.springblade.modules.repair.entity.MaintainCheckHistory;import org.springblade.modules.repair.vo.MaintainCheckHistoryVO;
import org.springblade.modules.repair.vo.PlanTemplateContentVO;
import org.springblade.modules.repair.vo.PlanTemplateVO;

import java.util.List;

public interface MaintainCheckHistoryMapper extends BaseMapper<MaintainCheckHistory> {
    /**
     * 自定义分页
     *
     * @param page
     * @param maintainCheckHistory
     * @return
     */
    List<MaintainCheckHistoryVO> selectMaintainCheckHistoryPage(IPage page, MaintainCheckHistoryVO maintainCheckHistory);

    Long selectBuildingByPlan(@Param("planId") Long planId);

    List<MaintainCheckHistoryVO> listCheckHistoryRecord(@Param("planId") Long planId, @Param("locationTypeId") Long locationTypeId);

    List<PlanTemplateVO> listPlanHistory(@Param("planId") Long planId,@Param("tltId") Long tltId,@Param("templateId")Long templateId);

	Integer countPlanTemplateTypeContent(@Param("planId") Long planId,@Param("templateId") Long templateId,@Param("tltId") Long tltId);

    List<PlanTemplateContentVO> getPlanWorkItemList(@Param("planId") Long planId);

	List<PlanCheckHistoryListDTO> getCheckHistoryList(@Param("planId") Long planId);
	/**
	 * 获取历史工作项的目标名称，按照排序
	 * @param planId 工单id
	 * @return 数据集
	 */
	@InterceptorIgnore(tenantLine = "on")
    List<String> getTemplateNames(@Param("planId") Long planId);

    List<MaintainCheckHistory> listByPlanId(@Param("planId") Long planId);

    MaintainCheckHistory selectByCheckHistoryId(@Param("id") Long id);
}
